<SCRIPT LANGUAGE="JavaScript">

function ValidateFields()

{

if(document.frmusers.username.value.length == 0)

{
alert('You must enter a username');
document.frmusers.username.focus();
return false;
}


if(document.frmusers.password.value.length == 0)

{
alert('You must enter a password');
document.frmusers.password.focus();
return false;
}


if(document.frmusers.name.value.length == 0)

{
alert('You must enter a name');
document.frmusers.name.focus();
return false;
}


if ((document.frmusers.email.value.indexOf('@') > 1) &&  (document.frmusers.email.value.indexOf('.') > (document.frmusers.email.value.indexOf('@') + 1)))

{

}

else

{
alert('Email addresses must have an @ sign and a dot (.) somewhere in it.');
document.frmusers.email.select();
document.frmusers.email.focus();
return false;
}


return true;
}
</SCRIPT>
